package com.dlc.apk.core

import com.dlc.apk.api.entity.OutGoodsData
import com.dlc.apk.utils.LogPlus

class ReportListener : IReportListener {
    override fun onShipmentResult(flowNo: Int, isShipmentDone: Boolean, attachData: Any?, msg: String?) {
        val resultStr = if (isShipmentDone) "设备出货完成" else "设备出货失败"
        LogPlus.e("###上报结果... $resultStr, msg->$msg")
        //先上报一次最新的心跳数据
        MQTTClient.publishHeart(MQTTClient.workStatusData)
        //上报结果
        if (attachData == null) {
            LogPlus.e("###待透传数据为null###")
            return
        }
        if (attachData !is OutGoodsData) {
            LogPlus.e("###待透传数据非OutGoodsData###")
            return
        }
        //doReportShipmentResult(attachData, isShipmentSuccess, 3)
    }
}